package com.tianqu.tms.entity;

import java.text.SimpleDateFormat;
import java.util.Date;

import com.tianqu.tms.core.base.Logger;
import com.tianqu.tms.core.base.TmsEntity;
import com.tianqu.tms.core.exception.TmsDaoException;
import com.tianqu.tms.core.exception.TmsException;
import com.tianqu.tms.core.util.MobileMessageBo;
import com.tianqu.tms.core.util.Registry;
import com.tianqu.tms.core.util.StringUtil;
import com.tianqu.tms.core.util.TmsConstants;
import com.tianqu.tms.core.util.car.CarInformationApi;
import com.tianqu.tms.core.util.car.IdentifyModelByVinBean;
import com.tianqu.tms.core.webservice.weichat.api.PullingExecutor;
import com.tianqu.tms.dao.TmsCarModelDaoImp;
import com.tianqu.tms.dao.TmsCarmodelVinDaoImp;
import com.tianqu.tms.dao.TmsDao;
import com.tianqu.tms.dto.TmsCarModelDto;
import com.tianqu.tms.dto.TmsCarmodelVinDto;

public class CarModelInfo extends TmsEntity{
	private CarInformationApi API = new CarInformationApi();
	private Logger LOGGER = Logger.getLogger(CarModelInfo.class);
	
	private static final CarModelInfo instance = new CarModelInfo();
	
	private CarModelInfo (){}
	
	public static CarModelInfo getInstance(){
		return instance;
	}
	//
	public TmsCarModelDto CarModelGet(String id) throws TmsDaoException{
		TmsCarModelDaoImp mDao = (TmsCarModelDaoImp) TmsDao.getInstance(TmsDao.TMS_CAR_MODEL);
		return mDao.get(id);
	}
	
	
	public void carModelInsert(TmsCarModelDto bean) throws TmsDaoException{
		TmsCarModelDaoImp mDao = (TmsCarModelDaoImp) TmsDao.getInstance(TmsDao.TMS_CAR_MODEL);
		mDao.insert(bean);
	}
	
	public void carModelUpdate(TmsCarModelDto bean) throws TmsDaoException{
		TmsCarModelDaoImp mDao = (TmsCarModelDaoImp) TmsDao.getInstance(TmsDao.TMS_CAR_MODEL);
		mDao.update(bean);
	}

    //
	public TmsCarmodelVinDto carmodelVinGet(String modelId,String vin) throws TmsDaoException{
		TmsCarmodelVinDaoImp mDao = (TmsCarmodelVinDaoImp) TmsDao.getInstance(TmsDao.TMS_CAR_MODEL_VIN);
		return mDao.get(modelId, vin);
	}
	
	public void carmodelVinInsert(TmsCarmodelVinDto bean) throws TmsDaoException{
		TmsCarmodelVinDaoImp mDao = (TmsCarmodelVinDaoImp) TmsDao.getInstance(TmsDao.TMS_CAR_MODEL_VIN);
		mDao.insert(bean);
	}

	public void carmodelVinUpdate(TmsCarmodelVinDto bean) throws TmsDaoException{
		TmsCarmodelVinDaoImp mDao = (TmsCarmodelVinDaoImp) TmsDao.getInstance(TmsDao.TMS_CAR_MODEL_VIN);
		mDao.update(bean);
	}
	 
	@Override
	public void save() throws TmsDaoException, TmsException {}
}
